<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// Route::get('/', function () {
//     return view('home.index.index');
// });

//后台
//主页

Route::get('/admin/index','Admin\IndexController@index');

//用户管理
Route::get('/admin/user/add','Admin\UserController@add');
Route::post('/admin/user/insert','Admin\UserController@insert');
Route::get('/admin/user/index','Admin\UserController@index');
//ajax修改用户名
Route::get('/admin/user/changename','Admin\UserController@changeName');
// Route::get('/admin/user/changestatus','Admin\UserController@changeStatus');

//用户编辑
Route::get('/admin/user/edit/{id}','Admin\UserController@edit');
Route::post('/admin/user/update','Admin\UserController@update');
Route::get('/admin/user/delete/{id}','Admin\UserController@delete');

//管理员 管理
Route::get('/admin/admin/add','Admin\AdminController@add');
Route::post('/admin/admin/insert','Admin\AdminController@insert');
Route::get('/admin/admin/index','Admin\AdminController@index');
//ajax修改管理员姓名
Route::get('/admin/admin/changename','Admin\AdminController@changeName');
Route::get('/admin/admin/changename','Admin\AdminController@changeName');
//管理员编辑
Route::get('/admin/admin/edit/{id}','Admin\AdminController@edit');
Route::post('/admin/admin/update','Admin\AdminController@update');
Route::get('/admin/admin/delete/{id}','Admin\AdminController@delete');


//分类管理
Route::resource('/admin/category','Admin\CategoryController');

//商品管理
Route::get('/admin/goods/index','Admin\GoodsController@index');
Route::get('/admin/goods/add','Admin\GoodsController@add');
Route::post('/admin/goods/insert','Admin\GoodsController@insert');

Route::get('/admin/goods/edit/{gid}','Admin\GoodsController@edit');
Route::post('/admin/goods/update/','Admin\GoodsController@update');
Route::get('/admin/goods/delete/{gid}','Admin\GoodsController@delete');

//后台订单管理
Route::get('/admin/order','Admin\OrderController@index');
Route::get('/admin/order/delete/{oid}','Admin\OrderController@delete');
Route::get('/admin/order/send/{oid}','Admin\OrderController@send');
Route::get('/admin/order/info/{oid}','Admin\OrderController@info');



//后台登录
Route::get('/admin/login','Admin\LoginController@login');
Route::post('/admin/login','Admin\LoginController@login');
Route::get('/admin/logout','Admin\LoginController@logout');
Route::get('/admin/code/{random?}','Admin\CodeController@code');

Route::get('/admin/reset/forget','Admin\ResetController@forget');
Route::post('/admin/reset/send','Admin\ResetController@send');
Route::get('/admin/reset/find/{token}','Admin\ResetController@find');
Route::get('/admin/reset/info','Admin\ResetController@info');
Route::post('/admin/reset/uppass','Admin\ResetController@uppass');


//前台注册
Route::get('/home/register','Home\RegisterController@register');
Route::post('/home/register','Home\RegisterController@register');
//前台登录(包括结算页跳转)
// Route::get('/home/login','Home\LoginController@login');

Route::get('/home/login/{flag?}','Home\LoginController@login');
Route::post('/home/login/{flag?}','Home\LoginController@login');

// Route::post('/home/login','Home\LoginController@login');
Route::get('/home/logout','Home\LoginController@logout');

//前台两个首页
Route::get('/home/shopindex','Home\IndexController@test');

// Route::post('/home/shopindex/menu','Home\IndexController@menu');
Route::get('/','Home\IndexController@index');
Route::get('/home/index','Home\IndexController@index');



//友情链接
Route::get('/admin/link/add','Admin\LinkController@add');
Route::post('/admin/link/insert','Admin\LinkController@insert');
Route::get('/admin/link/index','Admin\LinkController@index');
Route::get('/admin/link/edit/{a_lid}','Admin\LinkController@edit');
Route::post('/admin/link/updata','Admin\LinkController@updata');
Route::get('/admin/link/delete/{a_lid}','Admin\LinkController@delete');
Route::get('/admin/link/up/{a_lid}','Admin\LinkController@up');
Route::get('/admin/link/down/{a_lid}','Admin\LinkController@down');
//轮播图
Route::get('/admin/lunbo/add','Admin\LunboController@add');
Route::post('/admin/lunbo/insert','Admin\LunboController@insert');
Route::get('/admin/lunbo/index','Admin\LunboController@index');
Route::get('/admin/lunbo/edit/{a_sid}','Admin\LunboController@edit');
Route::post('/admin/lunbo/update','Admin\LunboController@update');
Route::get('/admin/lunbo/delete/{a_sid}','Admin\LunboController@delete');




//个人中心
Route::get('/home/userinfo','Home\UserinfoController@index');
Route::post('/home/userinfo','Home\UserinfoController@index');//这个添加
Route::post('/home/userinfo/update','Home\UserinfoController@update');//这个添加
Route::get('/home/userinfo/edit/{addrid}/{flag?}','Home\UserinfoController@edit');
Route::get('/home/userinfo/delete/{addrid}','Home\UserinfoController@delete');
Route::get('/home/userinfo/order','Home\UserinfoController@order');
Route::get('/home/userinfo/order_info/{oid}','Home\UserinfoController@order_info');
//个人信息
Route::get('/home/info','Home\InfoController@index');
Route::get('/home/info/password','Home\InfoController@password');
Route::post('/home/info/reset','Home\InfoController@reset');
Route::get('/home/info/edit','Home\InfoController@edit');
Route::post('/home/info/update','Home\InfoController@update');

//手机商品列表
Route::get('/home/list','Home\ListController@index');
Route::get('/home/list','Home\ListController@index');

//商品详情页
Route::get('/home/detail/{gid}','Home\GoodsController@detail');
Route::get('/home/detail/col','Home\GoodsController@col');

//商品购物车结算页
Route::get('/home/cart/index','Home\CartController@index');
Route::get('/home/cart/insert/{gid}/{uid?}','Home\CartController@insert');
Route::get('/home/cart/delete/{id}','Home\CartController@delete');
//ajax修改数量
Route::get('/home/cart/cut','home\CartController@cut');
Route::get('/home/cart/add','home\CartController@add');

//前台确认订单
Route::get('/home/order/index','Home\OrderController@index');
Route::post('/home/order/insert','Home\OrderController@insert');
Route::get('/home/order/finish','Home\OrderController@finish');
Route::get('/home/order/pay/{oid}','Home\OrderController@pay');
Route::get('/home/order/pay_finish','Home\OrderController@pay_finish');
Route::get('/home/order/delete/{oid}','Home\OrderController@delete');
Route::get('/home/order/receipt/{oid}','Home\OrderController@receipt');
